/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package servicios;

import dao.Categoria;
import dao.Pregunta;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Suco
 */
public class preguntaServicios {
    
    Pregunta pr;

    public preguntaServicios(Pregunta pr) {
        this.pr = pr;
    }
    
    public ArrayList<Pregunta> getListaPregunta(){
    
        ArrayList<Pregunta> ap=new ArrayList<Pregunta>();
        Pregunta pregunta;
        ResultSet rs=pr.consultaTodos();
    
         try {
            while(rs.next()){
                pregunta=new Pregunta(rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getString(6), rs.getString(7),rs.getString(8), rs.getString(9));
                ap.add(pregunta);
            }
            } catch (SQLException ex) {
            Logger.getLogger(categoriaServicios.class.getName()).log(Level.SEVERE, null, ex);
        }
           return ap;
    
    }
}
